<template>
     <h2 style="text-align: center;">登录列表</h2>
     <table border="1">
          <thead>
              <tr>
                <th>序号</th>
                <th>用户名</th>
                <th>密码</th>
                <th>注册时间</th>
              </tr>
          </thead>
          <tbody>
             <tr v-for="item in UserInfo" >
                <td>{{item.U_Id}}</td>
                <td>{{item.U_Name}}</td>
                <td>***</td>
                <td>{{item.U_Date.substring(0,10)}}</td>
             </tr>
          </tbody>
     </table>
</template>

<script setup lang="ts">
import { ref,onMounted} from 'vue';

import axios from 'axios';



const UserInfo = ref([{
    U_Id:"",
    U_Name:'',
    U_PassWord:'',
    U_Date:""
}])

onMounted(()=>{
    LoadData()
})

const LoadData = ()=>{
     axios.get("https://localhost:44331/api/Users/ShowUserLoginInfo").then(res=>{
        console.log(res.data)
         UserInfo.value = res.data
     }).catch(err=>{
         console.log(err)
     })
}
</script>